<template>
  <div class="budgetForm">
    <div class="header">
      <p style="margin-right:30px"><strong>项目编号：</strong>{{projectBuildData.projectNo}}</p>
      <p><strong>项目名称：</strong>{{projectBuildData.projectName}}</p>
    </div>
    <div class="content">
      <div class="selectedLine">
        是否需要预算：
        <a-radio-group v-model="projectBuildData.projectSendBudget" :disabled="projectBuildData.projectClass=='40'" @change="onChange">
          <a-radio :value="1">
            是
          </a-radio>
          <a-radio :value="0">
            否
          </a-radio>
        </a-radio-group>
        <a-button type="primary" style="margin-left: 20px;" v-show="projectBuildData.projectSendBudget==1&&btnShow" @click="addFactory">新增费用</a-button>
      </div>
      <ul class="costInfo" v-show="projectBuildData.projectSendBudget==1">
        <li class="info-card" v-for="budgetGroup in projectBudgetData" v-bind:key="budgetGroup.factoryCode">
          <a-card>
            <div v-show="btnShow">
              <a-icon type="delete" style="cursor: pointer;color: red;" title="删除预算" @click="delBudget(budgetGroup)"/>
            </div>
            <a-form-model
              class="hte-form-model" 
              ref="ruleForm"
              :model="budgetGroup"
            >
              <a-row :gutter="24">
                <a-col :span="8">
                  <a-form-model-item label="费用支出公司" prop="factoryName">
                    <a-input disabled
                      v-model="budgetGroup.factoryName"
                    />
                  </a-form-model-item>
                </a-col>  
                <a-col :span="8">
                  <a-form-model-item label="代码" prop="factoryCode" class="disable-input-bg">
                    <span style="font-weight: bolder">{{budgetGroup.factoryCode+'('+budgetGroup.factory+')'}}</span>
                  </a-form-model-item>
                </a-col>              
                <a-col :span="8">
                  <a-form-model-item label="成本中心号" prop="costCenterNo">
                    <!--<a-textarea auto-size v-model="budgetGroup.costCenterNo" @blur="checkCostCenterNo(budgetGroup)" placeholder="必须以费用支出公司代码前两位开头，多个号码英文逗号[,]分隔"/>-->
                    <a-input readOnly v-model="budgetGroup.costCenterNo" placeholder="请选择成本中心号" @click="selectCostCenter(budgetGroup)"/>
                  </a-form-model-item>
                </a-col>
              </a-row>
              <a-row :gutter="24" v-for="budgetItem in budgetGroup.budgetList" v-bind:key="budgetItem.projectBudgetCode">
                <a-col :span="8" v-if="projectBuildData.status===1">
                  <a-form-model-item :label="budgetItem.budgetItem" prop="amount">
                    <a-input
                      style="text-align: right;padding-right: 90px"
                      prefix="￥"
                      suffix="元(不含税)"
                      v-model="budgetItem.amount"
                      decimalSeparator=".00"
                      @blur="amountBlur($event,budgetItem)"
                      @focus="amountFocus($event,budgetItem)"
                    />
                  </a-form-model-item>
                </a-col>
                <a-col :span="16" v-if="projectBuildData.status===1">
                  <a-form-model-item label="说明" prop="memo">
                    <a-textarea auto-size v-model="budgetItem.memo"></a-textarea>
                  </a-form-model-item>
                </a-col>
                <a-col :span="8" v-if="projectBuildData.status>1">
                  <a-form-model-item :label="budgetItem.budgetItem" prop="amount">
                    <a-input
                      style="text-align: right;padding-right: 90px"
                      prefix="￥"
                      suffix="元（不含税）"
                      v-model="budgetItem.auditAmount"
                      decimalSeparator=".00"
                      @blur="amountBlur($event,budgetItem)"
                      @focus="amountFocus($event,budgetItem)"
                    />
                  </a-form-model-item>
                </a-col>
                <a-col :span="16"  v-if="projectBuildData.status>1">
                  <a-form-model-item label="说明" prop="memo">
                    <a-textarea auto-size v-model="budgetItem.auditMemo"></a-textarea>
                  </a-form-model-item>
                </a-col>
              </a-row>
            </a-form-model>
          </a-card>
        </li>
      </ul>
      <ul class="totalExpenses" v-show="projectBuildData.projectSendBudget==1">
        <li>
          总费用（元）：
          <span>￥</span><span>{{totalAmount}}</span><span>（￥</span>{{totalTenThousand}}<span>万）</span>
        </li>
        <li style="color:red;margin-left:30px;" v-show="totalTenThousand >=50 && ['40','41'].includes(projectBuildData.projectClass)&&['GA','GB','GC','GD','GE','GF'].includes(projectBuildData.projectTypeSubCategory)">注意：项目预算总额≥50万元，需在提交审批前提交项目技术会审。</li>
        <!--<li  v-show="projectBuildData.projectSendBudget===1&&projectBudgetData.status>=4">
          已用费用（元）：
          <span>￥60,000,000.00（￥6,000,.00万）</span>
        </li>
        <li  v-show="projectBuildData.projectSendBudget===1&&projectBudgetData.status>=4">
          剩余费用（元）：
          <span>￥60,000,000.00（￥6,000,.00万）</span>
        </li>-->
      </ul>
      <!--<div class="detailList" v-show="projectBuildData.projectSendBudget===1&&projectBudgetData.status>=4">
        <p><span class="icon-dingdan iconfont"></span><strong>已用明细</strong></p>
        <a-table
          :columns="detailList"
          :data-source="costDetailData"
          rowKey='id'
          :pagination="false"
          :indentSize='20'
          size="middle"
          bordered
        />
      </div>-->
    </div>
    <a-modal title="选择费用支出公司" :visible="showAddFactory" @ok="doAddFactory" @cancel="cancelAddFactory">
      <ul class="info-list">
        <li style="margin-bottom: 20px">
          <img src="@/assets/dbcircle.png" alt="" />
          <span class="list-title">选择费用支出公司：</span>
          <a-input-search
            placeholder="费用支出公司"
            readOnly
            v-model:value="selectFactoryData.name"
            @click="openFactorySelector()"
            style="width: 250px"
          />
        </li>
        <li style="margin-bottom: 20px">
          <img src="@/assets/dbcircle.png" alt="" />
          <span class="list-title">选择成本中心号：</span>
          <a-input
            style="width: 250px"
            placeholder="请选择成本中心号"
            v-model="addCostCenterNo"
            readOnly
            @click="selectCostCenter"
          />
        </li>
      </ul>
    </a-modal>
    <FactorySelector @close="selectFactorySelector" ref="FactorySelector" />
    <!--成本中心号选择-->
    <table-select-modal
      ref="costCenterSelect"
      :title="costCenterData.title"
      :searchPlaceholder="costCenterData.searchPlaceholder"
      :importColumns="costCenterData.columns"
      :params="costCenterData.params"
      :keywordKey="costCenterData.keywordKey"
      :isAllSelect="false"
      :listUrl="costCenterData.url"
      @ok="costCenterHandleOk"
    />
  </div>
</template>
<script>
  import Vue from 'vue'
import { USER_NAME } from "@/store/mutation-types"
import { httpAction, getAction,postAction ,postActionAsync } from '@/api/manage'
  import { Modal } from 'ant-design-vue'
export default {
  components: {
    TableSelectModal:()=>import('@/components/tools/TableSelectModal'),
    FactorySelector: () => import('@/views/projectChange/FactorySelector'),
  },
  data () {
    return {
      loadingDone:false,
      btnShow:false,
      showAddFactory:false,
      projectBuildId:this.$route.query.projectBuildId,
      currentAudit:this.$route.query.currentAudit,
      changeFlag:this.$route.query.changeFlag,
      currentUserId: Vue.ls.get(USER_NAME),
      projectBuildData:{projectNo:'',projectName:''},
      projectBudgetData:[],
      factoryOptions:[],
      factoryData:[],
      selectFactoryData:{},
      addCostCenterNo: '',
      budgetItemData:[],
      totalAmount:0,
      totalTenThousand:0,
      projectChangeData:null,
      changeTarget:2,
      url:{
        queryBuildById:'/projectBuild/getNormalVo',
        queryListByBuildId:'/projectBuildBudget/queryByBuildId',
        delBatch:'/projectBuildBudget/delBatch',
        saveBudget:'/projectBuildBudget/saveBudget',
        saveTeam:'/projectBuildTeam/saveTeam',
        getCodeInfoList:'/manage/codeInfo/queryByType',
        queryChangeByBuildId:'/projectChange/queryByBuildId',
        queryChangeDetailById:'/projectChange/queryDetailByBuildId',
        saveBudgetChange:'/projectChange/saveBudgetChange',
        delBudgetChange:'/projectChange/delBudgetChange'
      },
      labelCol: { span: 8 },
      wrapperCol: { span: 15 },
      detailList : [
        { title: '项目号', width:'20%',align:'left',dataIndex: 'projectNo', key: 'projectNo' },
        { title: '名称', width:'50%',align:'center',dataIndex: 'name', key: 'name' },
        { title: '费用（元）', width:'30%',align:'center',dataIndex: 'cost', key: 'cost' },
      ],
      costDetailData:[],
      costCenterData:{
        title:'选择成本中心号',
        searchPlaceholder:'请输入关键词进行模糊搜索',
        visible:false,
        url:'/costCenter/list',
        params:{companyCode:'',costCenterName:''},
        keywordKey:"costCenterName",
        columns: [
          {
            title: '成本中心号',
            dataIndex: 'costCenter',
            align: 'center',
          },
          {
            title: '成本中心名称',
            dataIndex: 'costCenterName',
            align: 'center',
          },
        ],
      },
      curBudgetGroup:{},
    }
  },
  mounted () {
    this.getProjectBuildData();
  },
  methods: {
    getProjectBuildData:function(){
      //debugger;
      getAction(this.url.queryBuildById,{id:this.projectBuildId}).then(res=>{
        this.projectBuildData=res.result||{};
        this.btnShow = ((this.projectBuildData.status === 1 || this.currentAudit === 'true' || this.changeFlag === 'true') && (this.projectBuildData.createUserId === this.currentUserId || this.projectBuildData.projectManagers.indexOf(this.currentUserId) >= 0 ||
          this.projectBuildData.assistantProjectManagers.indexOf(this.currentUserId) >= 0));
        this.getFactoryData();
        this.getBudgetItemData();
        if(this.changeFlag==='true'){
          this.btnShow =false;
          // this.getProjectChangeData();
        }
        //debugger
        if(this.projectBuildData.projectClass=='40'){
          this.projectBuildData.projectSendBudget=1;
        } else if(this.projectBuildData.projectSendBudget!=null){
          this.projectBuildData.projectSendBudget=this.projectBuildData.projectSendBudget?1:0;
        }
        this.getProjectBudgetData();
      })
    },
    getProjectChangeData(){
      getAction(this.url.queryChangeByBuildId,{buildId:this.projectBuildId}).then(res=>{
        if(res.result){
          this.btnShow = (this.projectBuildData.createUserId === this.currentUserId || this.projectBuildData.projectManagers.indexOf(this.currentUserId) >= 0 ||
            this.projectBuildData.assistantProjectManagers.indexOf(this.currentUserId) >= 0||
            (this.projectBuildData.projectClass=='40'&&this.projectBuildData.projectMembers.indexOf(this.currentUserId)>=0)) && res.result.status === 1;
          this.projectChangeData=res.result;
        }
      })
    },
    getProjectBudgetData(){
      // if(this.changeFlag==='true'){
      //   getAction(this.url.queryChangeDetailById,{buildId:this.projectBuildId,changeTarget:this.changeTarget}).then(res=>{
      //     if(res.result){
      //       this.projectBuildData.projectSendBudget=res.result.projectSendBudget?1:0;
      //       this.projectBudgetData=res.result.projectBudgetData||[];
      //       if(this.projectBudgetData.length>0){
      //         this.projectBudgetData.forEach(function(item){
      //           item.budgetList.forEach(function(budget){
      //             budget.auditAmount=parseFloat(budget.auditAmount).toLocaleString();
      //           });
      //         })
      //       }
      //       this.totalBudget();
      //     }else{
      //       this.doGetProjectBudgetData();
      //     }
      //   })
      // }else{
      //   this.doGetProjectBudgetData();
      // }
      this.doGetProjectBudgetData();
    },
    doGetProjectBudgetData(){
      getAction(this.url.queryListByBuildId,{projectBuildId:this.projectBuildId}).then(res=>{
        this.projectBudgetData=res.result||[];
        if(this.projectBudgetData.length>0){
          const that=this;
          this.projectBudgetData.forEach(function(item){
            item.budgetList.forEach(function(budget){
              if(that.projectBuildData.status===1){
                budget.amount=parseFloat(budget.amount).toLocaleString();
              }else{
                budget.auditAmount=parseFloat(budget.auditAmount).toLocaleString();
              }
            });
          })
        }
        this.totalBudget();
        this.loadingDone=true;
      })
    },
    totalBudget(){
      this.totalAmount=0;
      this.totalTenThousand=0;
      if(this.projectBudgetData.length>0){
        const that=this;
        this.projectBudgetData.forEach(function(item){
          item.budgetList.forEach(function(budget){
            that.totalAmount+=that.projectBuildData.status===1?parseFloat(budget.amount.replace(/,/g,'')):parseFloat(budget.auditAmount.replace(/,/g,''));
          });
        })
      }
      if(this.totalAmount>0){
        this.totalTenThousand=(this.totalAmount/10000).toFixed(2);
        this.totalAmount=this.totalAmount.toLocaleString();
        this.totalTenThousand=parseFloat(this.totalTenThousand).toLocaleString();
      }
    },
    getFactoryData(){
      const that=this;
      getAction(this.url.getCodeInfoList,{type:"项目需求公司"}).then(res=>{
        this.factoryData=res.result||[];
        if(this.factoryData.length>0){
          this.factoryData.forEach(function(item){
            that.factoryOptions.push({value:item.parentid.trim(),label:item.name});
          })
        }
      })
    },
    getBudgetItemData(){
      getAction(this.url.getCodeInfoList,{type:this.projectBuildData.projectTypeSubCategory+"类项目预算项"}).then(res=>{
        this.budgetItemData=res.result||[];
      })
    },
    openFactorySelector() {
      this.$refs.FactorySelector.openInit({ returnParam: { type: 'add' } })
    },
    selectFactorySelector(item) {
      this.selectFactoryData = item;
      this.$set(this.selectFactoryData, 'name', item.name)
      if(this.costCenterData.params.companyCode != this.selectFactoryData.parentid){
        this.addCostCenterNo='';
      }
      let checkData=this.projectBudgetData.filter(b=>b.factoryCode===this.selectFactoryData.parentid);
      if(checkData&&checkData.length>0){
        this.$message.warning('已存在费用支出公司 ['+checkData[0].factoryName+"] 预算，不能重复添加");
      }
    },
    selectCostCenter(budgetGroup){
      if(this.showAddFactory){
        if (!this.selectFactoryData.name) {
          this.$message.warning('请选择费用支出公司')
          return
        }
        this.costCenterData.params.companyCode = this.selectFactoryData.parentid;
      }else{
        this.curBudgetGroup=budgetGroup;
        this.costCenterData.params.companyCode=this.curBudgetGroup.factoryCode;
      }
      this.$refs.costCenterSelect.open()
    },
    costCenterHandleOk(costCenterData){
      if(this.showAddFactory){
        this.addCostCenterNo = costCenterData[0].costCenter
      }else{
        this.curBudgetGroup.costCenterNo=costCenterData[0].costCenter;
      }
      this.$refs.costCenterSelect.close()
    },
    addFactory(){
      this.selectFactoryData={};
      this.addCostCenterNo='';
      this.showAddFactory=true;
    },
    doAddFactory(){
      if (!this.selectFactoryData.name) {
        this.$message.warning('请选择费用支出公司')
        return
      }
      if (!this.addCostCenterNo && this.addCostCenterNo.trim() === '') {
        this.$message.warning('请选择成本中心号')
        return
      }
      let checkData=this.projectBudgetData.filter(b=>b.factoryCode===this.selectFactoryData.parentid);
      if(checkData&&checkData.length>0){
        this.$message.warning('已存在费用支出公司 ['+checkData[0].factoryName+"] 预算，不能重复添加");
        return;
      }
      let factory=this.factoryData.filter(f=>f.parentid.trim()===this.selectFactoryData.parentid)[0];
      let budgetGroup={
        factory:factory.code.trim(),
        factoryName:factory.name.trim(),
        factoryCode:factory.parentid,
        costCenterNo:this.addCostCenterNo,
        budgetList:[]
      };
      const that=this;
      this.budgetItemData.forEach(function(item){
        let budget={
          id:'',
          factory:factory.code.trim(),
          factoryName:factory.name.trim(),
          factoryCode:factory.parentid,
          costCenterNo:that.addCostCenterNo,
          projectBuildId:that.projectBuildId,
          amount:'0',
          memo:'',
          auditAmount:'0',
          auditMemo:'',
          projectBudgetCode:item.code.trim(),
          budgetItem:item.name.trim(),
          wbs:item.parentid,
          wbsName:that.projectBuildData.projectName+'-'+item.name.trim(),
          wbsLevel:3,
          costType:item.additional_field
        };
        budgetGroup.budgetList.push(budget);
      });
      this.projectBudgetData.push(budgetGroup);
      this.showAddFactory=false;
    },
    cancelAddFactory(){
      this.showAddFactory=false;
    },
    delBudget(budgetGroup){
      const that=this;
      Modal.confirm({
        title:'提示',
        content: '确定删除费用支出公司 ['+budgetGroup.factoryName+'] 的预算数据？',
        onOk() {
          that.doDelBudget(budgetGroup);
        },
        onCancel() {},
      });
    },
    doDelBudget(budgetGroup){
     // debugger;
      const that=this;
      budgetGroup.budgetList.forEach(function(item){
        if(that.projectBuildData.status==1){
          item.amount=item.amount.replace(/,/g,'');
        }else{
          item.auditAmount=item.auditAmount.replace(/,/g,'');
        }
      });
      if(this.changeFlag==='true'){
        budgetGroup.projectBuildId=this.projectBuildId;
        postAction(this.url.delBudgetChange,budgetGroup).then(res=>{
          if(res.success){
            that.$message.success('删除成功');
            that.projectBudgetData.forEach(function(group,index){
              if(group.factoryCode=budgetGroup.factoryCode){
                that.projectBudgetData.splice(index,1);
              }
            });
          }else{
            that.$message.warning('删除失败:'+res.message);
          }
        })
      }else{
        postAction(this.url.delBatch,budgetGroup.budgetList).then(res=>{
          if(res.success){
            that.$message.success('删除成功');
            that.projectBudgetData.forEach(function(group,index){
              if(group.factoryCode=budgetGroup.factoryCode){
                that.projectBudgetData.splice(index,1);
              }
            });
          }else{
            that.$message.warning('删除失败:'+res.message);
          }
        })
      }
    },
    amountBlur(event,budgetItem){
      let checkAmount;
      if(this.projectBuildData.status===1){
        budgetItem.amount=budgetItem.amount===''?0:budgetItem.amount;
        checkAmount=parseFloat(budgetItem.amount);
      }else{
        budgetItem.auditAmount=budgetItem.auditAmount===''?0:budgetItem.auditAmount;
        checkAmount=parseFloat(budgetItem.auditAmount);
      }
      if(isNaN(checkAmount)){
        this.$message.warning('请正确输入预算金额');
        return;
      }
      if(checkAmount<1000||checkAmount>10000000){
        this.$info({
          title: '提示',
          content: '费用金额单位为元，填写时请注意',
          onOk() {},
        });
      }
      if(this.projectBuildData.status===1){
        budgetItem.amount=parseFloat(checkAmount.toFixed(2)).toLocaleString();
      }else{
        budgetItem.auditAmount=parseFloat(checkAmount.toFixed(2)).toLocaleString();
      }
      this.totalBudget();
    },
    amountFocus(event,budgetItem){
      if(this.projectBuildData.status===1&&budgetItem.amount.indexOf(',')){
        budgetItem.amount=budgetItem.amount.replace(/,/g,'');
      }
      if(this.projectBuildData.status>1&&budgetItem.auditAmount.indexOf(',')){
        budgetItem.auditAmount=budgetItem.auditAmount.replace(/,/g,'');
      }
    },
    checkCostCenterNo(budgetGroup){
      let factoryName=budgetGroup.factoryName;
      // let factoryCode = budgetGroup.factoryCode.substring(0,2);
      if(budgetGroup.costCenterNo.trim()===''){
        this.$message.warning('请选择费用支出公司 ['+factoryName+'] 的成本中心号');
        return false;
      }
      // let costCenterNoReg=null;
      // eval(" costCenterNoReg= /^"+factoryCode+"\\d+((,"+factoryCode+"\\d+)*)?$/;");
      //
      // if(!costCenterNoReg.test(budgetGroup.costCenterNo)){
      //   this.$message.warning("费用支出公司 ["+factoryName+"] 成本中心号必须以代码的前2位开头，只能填写数字，多个成本中心号英文逗号[,]分隔");
      //   return false;
      // }
      return true;
    },
    onChange(){

    },
    async doSubmit(){
      if(!this.btnShow||!this.loadingDone){
        return 2;
      }
      const that=this;
      if(this.projectBuildData.projectSendBudget==1&&this.projectBudgetData.length===0){
        this.$message.warning('请先添加预算数据');
        return 0;
      }
      if(this.projectBuildData.projectSendBudget==null){
        this.$message.warning('请选择【是否需要预算】');
        return 1;
      }
      let success=0;
      if(this.projectBuildData.projectSendBudget==0){
        if(this.projectBudgetData.length>0){
          Modal.confirm({
            title:'提示',
            content: '下达预算为“否”，将会清空原来填写的预算数据，确定保存',
            async onOk() {
              if(that.changeFlag==='true'){
                success=await that.doSaveBudgetChange();
              }else{
                success=await that.doSaveBudget();
              }
            },
            onCancel() {},
          });
        }else{
          if(that.changeFlag==='true'){
            success=await that.doSaveBudgetChange();
          }else{
            success=await that.doSaveBudget();
          }
        }
        return success;
      }
      let saveList=[];
      for(let i=0;i<this.projectBudgetData.length;i++){
        let budgetGroup=this.projectBudgetData[i];
        if(!this.checkCostCenterNo(budgetGroup)){
          return 0;
        }
        let budgetList=budgetGroup.budgetList;
        for(let j=0;j<budgetList.length;j++){
          //拷贝
          let budgetItem=JSON.parse(JSON.stringify(budgetList[j]));
          let checkAmount=this.projectBuildData.status===1?parseFloat(budgetItem.amount.replace(/,/g,'')):parseFloat(budgetItem.auditAmount.replace(/,/g,''));
          if(isNaN(checkAmount)){
            this.$message.warning('请正确输入费用支出公司 ['+budgetGroup.factoryName+'] 的 ['+budgetItem.budgetItem+'] 金额');
            return 0;
          }
          if(this.projectBuildData.status===1){
            budgetItem.amount=budgetItem.amount.replace(/,/g,'');
          }else{
            budgetItem.auditAmount=budgetItem.auditAmount.replace(/,/g,'');
          }
          budgetItem.costCenterNo=budgetGroup.costCenterNo;
          saveList.push(budgetItem);
        }
      }
      this.projectBuildData.budgetList=saveList;
      if(that.changeFlag==='true'){
        return await that.doSaveBudgetChange();
      }else{
        return await this.doSaveBudget();
      }
    },
    async doSaveBudget(){
      const that=this;
      let success=0;
      await postActionAsync(this.url.saveBudget,this.projectBuildData).then(res=>{
        if(res.success){
          that.$message.success('保存成功');
          success=2;
          that.getProjectBudgetData();
        }else{
          that.$message.warning('保存失败:'+res.message);
        }
      }).catch(res=>{
        that.$message.warning('保存失败:'+res.message);
      });
      return success;
    },
    async doSaveBudgetChange(){
      const that=this;
      let changeData={projectBuildId:this.projectBuildId,projectSendBudget:this.projectBuildData.projectSendBudget,projectBudgetData:[]};
      if(this.projectBuildData.projectSendBudget==1){
        if(this.projectBudgetData&&this.projectBudgetData.length>0){
          let projectBudgetData=JSON.parse(JSON.stringify(this.projectBudgetData));
          projectBudgetData.forEach(function(group){
            group.budgetList.forEach(function(item){
              item.auditAmount=item.auditAmount.replace(/,/g,'');
              item.costCenterNo=group.costCenterNo;
            })
          });
          changeData.projectBudgetData=projectBudgetData;
        }
      }
      let success=0;
      await postActionAsync(this.url.saveBudgetChange,changeData).then(res=>{
        if(res.success){
          that.$message.success('保存成功');
          success=2;
          that.getProjectBudgetData();
        }else{
          that.$message.warning('保存失败:'+res.message);
        }
      }).catch(res=>{
        that.$message.warning('保存失败:'+res.message);
      });
      return success;
    }
  }
}
</script>
<style lang="less" scoped>
@import '~@assets/less/hte-main.less';
/deep/ .ant-card-body{
  box-shadow: 2px 4px 12px rgba(0,0,0,.1);
  position: relative;
  >div{
    position: absolute;
    right: 7px;
    top: 4px;
  }
}
/deep/ .ant-table-thead > tr > th {
  background: #dadee9 !important;
}
/deep/.ant-table-thead > tr:first-child > th:first-child,/deep/ .ant-table table{
  border-radius: unset;
  line-height: 1;
}
/deep/ .ant-btn-primary{
  width: 85px;
  height: 30px;
  border-radius: 2px;
  background: #4095e4;
  margin-right: 10px;
}
/deep/ .default{
  width: 85px;
  height: 30px;
  border-radius: 2px;
}
.iconfont{
  color: #d9dee8;
  margin-right: 3px;
}
.budgetForm{
  border: 1px solid #e6e6e6;
  background-color: #fff;
  padding-bottom: 30px;
  .header{
    border-bottom: 1px solid #e6e6e6;
    display: flex;
    padding: 30px 0 0 25px;
  }
  .content{
    padding: 20px 25px;
    ul{
      list-style: none;
      padding: 0;
    }
    .costInfo{
      padding-bottom: 30px;
      border-bottom: 1px solid #e6e6e6;
      li{
        padding-top: 20px;
      }
    }
    .totalExpenses{
      display: flex;
      // justify-content: space-between;
    }
  }
  .btn{
    display: flex;
    justify-content: center;
  }
}
/deep/ .ant-input-affix-wrapper .ant-input {
  padding-right: 10px !important;
}

.info-list {
  display: flex;
  flex-wrap: wrap;
  border-bottom: 1px dashed #ebebeb;

  > li {
    width: 100%;
    height: 25px;
    display: flex;
    align-items: center;

    > img {
      margin-right: 5px;
    }

    .list-title {
      width: 150px;
      font-weight: 900;
    }
  }
}

/deep/ .ant-transfer-list .ant-btn-primary{
  color: #bbb;
}
/deep/ .ant-transfer-list:first-of-type .ant-transfer-list-header-selected{
  display: none;
}
/deep/ .ant-modal-content{
  border-radius: 15px;
}
/deep/ .ant-modal-title,/deep/ .ant-modal-footer{
  text-align: center;
}
/deep/ .ant-transfer-operation .ant-btn-primary{
  background-color: #f5f5f5 !important;
}
/deep/ .ant-modal-header{
  border-radius: 15px 15px 0 0;
  background-image: linear-gradient(90deg, #15b1ff 0%,#1158c9 100%);
}
/deep/ .ant-modal-title{
  color: #fff;
}

</style>